package com.swgk.core;

import androidx.multidex.MultiDexApplication;

import com.swgk.core.base.api.BaseApiSourceImpl;


/**
 * Description:
 * Author zhengkewen
 * Time 2019/4/2
 */
public abstract class BaseAppApplication extends MultiDexApplication {

    abstract protected BaseApiSourceImpl getApiSoure();

    abstract protected String getBaseUrl();

    abstract protected String getDbPath();

    abstract protected <T> Class<T> getPreferenceSourceClass();

    @Override
    public void onCreate() {
        super.onCreate();
        BaseAppHelper.get().onCreate(this, getPreferenceSourceClass(), getApiSoure(), getBaseUrl());
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
        BaseAppHelper.get().onTerminate();
    }
}
